import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios';  //npm 下载的直接引入就行
import NavView from './components/NavView.vue'
import FooterView from './components/FooterView.vue'
import AdminView from './components/AdminView.vue'
import CateGory from './components/CateGory.vue'
import TagView from './components/TagView.vue'



Vue.component('NavView', NavView) //然后 注册全局组件
Vue.component('FooterView', FooterView)
Vue.component('AdminView', AdminView)
Vue.component('CateGory', CateGory)
Vue.component('TagView', TagView)

// Vue.components({
//   NavView,
//   FooterView, AdminView, CateGory,
// })

axios.defaults.baseURL = 'http://47.104.167.34:9110/api'  //配置服务器默认请求地址
axios.interceptors.request.use((config) => {

  // config.headers.token = localStorage.getItem('token')

  return config
})

Vue.use(ElementUI);
Vue.prototype.$axios = axios
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
